cmake_minimum_required(VERSION 3.5.1)
project(Stack)

if(BUILD_TOTAL STREQUAL ON)
	set(SEQSTACK_SRC SeqStack/seqstack.c)
	set(LINSTACK_SRC LinStack/linstack.c)
	
	set(STACK_SRC ${SEQSTACK_SRC} ${LINSTACK_SRC})

	add_library(LStack STATIC ${STACK_SRC})
	add_library(lstack SHARED ${STACK_SRC})
	
	install(TARGETS LStack ARCHIVE DESTINATION ${INSTALL_DIR}/lib/liblds)
	install(TARGETS lstack LIBRARY DESTINATION ${INSTALL_DIR}/lib/${CMAKE_LIBRARY_ARCHITECTURE})
	install(FILES ${INCLUDE_DIR}/Stack/*.h DESTINATION ${INSTALL_DIR}/include/liblds)
else()
	add_subdirectory(SeqStack/) # Sequence List Stack 基于顺序表的栈
	add_subdirectory(LinStack/) # Linked List Stack   基于链表的栈
endif()
